package com.um.jdy.platform.activity.controller;

import com.um.jdy.platform.activity.entity.dto.StationPageDTO;
import com.um.jdy.platform.activity.manager.ChargeActivityManager;
import com.um.jdy.platform.station.entity.vo.StationItemVO;
import com.um.springboot.starter.annotation.ApiPermission;
import com.um.springboot.starter.annotation.TokenRequired;
import com.um.springboot.starter.entity.Page;
import com.um.springboot.starter.orm.controller.BaseController;
import com.um.springboot.starter.orm.entity.Response;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 控制器：营销活动公共管理
 */
@RestController
@RequestMapping("/api/v1/cms/activity")
@Api(tags = "营销管理")
@ApiPermission("activity_station")
@TokenRequired
public class ChargeActivityController extends BaseController<ChargeActivityManager> {

    @ApiPermission("page")
    @ApiOperation(value = "分页查站场")
    @PostMapping("/station/page")
    public Response<Page<StationItemVO>> getActivityStationPage(@RequestBody StationPageDTO params){
        return Response.success(manager.getActivityStationPage(params.toPageParams()));
    }
}
